import React from 'react';
import Grandepa from './compontent/Grandepa';
import Mycontext from './Mycontext';

console.log(Mycontext)
const {Provider}=Mycontext;
  class App extends React.Component{
      constructor(props){
        super(props)
        this.state={
          msg:'hello'
        }
      }
      addMsg(){
        this.setState({
          msg:'welcome to Wuhan'
        })
      }


      render(){
        return(
          <div>
            <Provider value={this.state}>
              <button onClick={e=>this.addMsg()}>修改</button>
              {this.state.msg}
              <Grandepa />
            </Provider>
           
          </div>
        )
      }
  }

export default App;
